package com.nelson.myapplication.objectdemo

/**
 * companion object 本质上还是一个静态内部类
 *
 * 与Java中的静态变量静态方法无异
 */
class CompanionObjectDemo1 {
    companion object {
        var name = "CompanionObject Name"

        fun doNothing() {

        }
    }
}

class CompanionObjectDemoRun {
    fun run() {
        CompanionObjectDemo1.name
        CompanionObjectDemo1.doNothing()
    }
}